package com.example.answer.choose;
import com.example.answer.AnalogyExaminationActivity;
import com.example.answer.MainActivity;
import com.example.answer.R;
import com.example.answer.androdi_db.MainActivity1;
import com.example.answer.login.LoginActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;


public class ChooseActivity extends Activity {
	
	private Button cTeacherButton;
	private Button cStudentButton;


	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.choose);

		cTeacherButton = (Button) findViewById(R.id.choose_teacher);
		cStudentButton = (Button) findViewById(R.id.choose_student);
		
		OnClickListener mListener = new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				switch (v.getId()) {
				case R.id.choose_teacher:
					teacher();
					break;
				case R.id.choose_student:
					student();
					break;
				}
			}
		};
		cTeacherButton.setOnClickListener(mListener);
		cStudentButton.setOnClickListener(mListener);
}
	protected void student() {
		// TODO Auto-generated method stub
		Intent intent=new Intent(ChooseActivity.this,LoginActivity.class);
		startActivity(intent);
		
	}
	protected void teacher() {
		// TODO Auto-generated method stub
		Intent intent=new Intent(ChooseActivity.this,MainActivity1.class);
		startActivity(intent);
		
	}
	
}